@layout("/common/_container.html"){
<div class="ibox float-e-margins">
    <div class="ibox-content" style="height: 476px;">
        <div class="form-horizontal" id="class-graduation-update">
            <input type="hidden" name="classIds" value="${clzz.id}"/>
            <input type="hidden" name="orgId" value="${clzz.orgId}"/>
            <div class="row">
                <div class="col-sm-12 b-r" id="class-add">
                    <div class="unit">
                        已选毕业年级：${clzz.grade}
                    </div>
                </div>

                <div class="unit">
                    该年级从本学段毕业，还是从本学校毕业了？
                </div>

                <div class="unit">
                    <input  onclick="graduationClass.changeGS(this)" type="radio" name="graduateState" value="6">从本学段毕业，还将继续在该学校继续进入下个学段，平台账号需要继续使用。
                </div>
                <div class="unit">
                    <input onclick="graduationClass.changeGS(this)" type="radio" name="graduateState" value="7">从本学校毕业，以后账号不需登录平台。
                </div>
            </div>
            </div>
        </div>

        <div class="row btn-group-m-t">
            <div class="col-sm-12" style="text-align: right">
                <#button btnCss="info" name="下一步" id="ensure" icon="fa-check" clickFun="graduationClass.next()"/>
            </div>
        </div>
    </div>
<style>
    .unit {
        display: block;
        margin: 0;
        padding: 8px 0;
        position: relative;
        clear: both;
    }
</style>
<script>
    var graduationClass = {
        id:'${clzz.id}',
        gradeId:'${clzz.gradeId}',
        graduateState:"",
        requestAjax:function(url,params,callback,returntype){
            if(returntype=="html"){
                dataType = "html";
            }else{
                dataType = "json";
            }
            $.ajax({
                type:"post",
                async : false,
                cache:false,
                dataType : dataType,
                url : url,
                data:params,
                success : function(data){
                    if(callback){
                        callback(data);
                    }
                }
            });
        },
        next(){
            var flag = true;
            if(!$("#class-graduation-update input:checked").val()){
                flag = false;
                Feng.error("先选择毕业方式");
            }
            if(flag){
                graduationClass.toStudentGraduationList();
            }
            return false;
        },
        toStudentGraduationList:function(){
            window.location.href=Feng.ctxPath+"/ptClass/classupdate/toUpdateStu?graduationStatus=5&orgId="+'${clzz.orgId}'+"&schoolYear="+'${clzz.schoolYear}'+"&gradeId="+'${clzz.gradeId}'+'&graduateState='+graduationClass.graduateState
        },

        appendHtml:function(html){
            $("#class-graduation-update").html(html);
        },
        changeGS:function(dom){
            $("#class-graduation-update input[type='radio']").removeAttr("checked");
            $(dom).prop("checked",true);
            graduationClass.graduateState = $(dom).val();
        }
    };

    if('${clzz.graduationStatus}'>5){
        graduationClass.graduateState = '${clzz.graduationStatus}';
        graduationClass.toStudentGraduationList();
    }
</script>
@}
